package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TReturnedOrdersMapper;
import com.ruoyi.system.domain.TReturnedOrders;
import com.ruoyi.system.service.ITReturnedOrdersService;

/**
 * 退货单信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-05-22
 */
@Service
public class TReturnedOrdersServiceImpl implements ITReturnedOrdersService 
{
    @Autowired
    private TReturnedOrdersMapper tReturnedOrdersMapper;

    /**
     * 查询退货单信息
     * 
     * @param returnedOrdersId 退货单信息主键
     * @return 退货单信息
     */
    @Override
    public TReturnedOrders selectTReturnedOrdersByReturnedOrdersId(String returnedOrdersId)
    {
        return tReturnedOrdersMapper.selectTReturnedOrdersByReturnedOrdersId(returnedOrdersId);
    }

    /**
     * 查询退货单信息列表
     * 
     * @param tReturnedOrders 退货单信息
     * @return 退货单信息
     */
    @Override
    public List<TReturnedOrders> selectTReturnedOrdersList(TReturnedOrders tReturnedOrders)
    {
        return tReturnedOrdersMapper.selectTReturnedOrdersList(tReturnedOrders);
    }

    /**
     * 新增退货单信息
     * 
     * @param tReturnedOrders 退货单信息
     * @return 结果
     */
    @Override
    public int insertTReturnedOrders(TReturnedOrders tReturnedOrders)
    {
        tReturnedOrders.setCreateTime(DateUtils.getNowDate());
        tReturnedOrders.setUpdateTime(DateUtils.getNowDate());
        return tReturnedOrdersMapper.insertTReturnedOrders(tReturnedOrders);
    }

    /**
     * 修改退货单信息
     * 
     * @param tReturnedOrders 退货单信息
     * @return 结果
     */
    @Override
    public int updateTReturnedOrders(TReturnedOrders tReturnedOrders)
    {
        tReturnedOrders.setUpdateTime(DateUtils.getNowDate());
        return tReturnedOrdersMapper.updateTReturnedOrders(tReturnedOrders);
    }

    /**
     * 批量删除退货单信息
     * 
     * @param returnedOrdersIds 需要删除的退货单信息主键
     * @return 结果
     */
    @Override
    public int deleteTReturnedOrdersByReturnedOrdersIds(String[] returnedOrdersIds)
    {
        return tReturnedOrdersMapper.deleteTReturnedOrdersByReturnedOrdersIds(returnedOrdersIds);
    }

    /**
     * 删除退货单信息信息
     * 
     * @param returnedOrdersId 退货单信息主键
     * @return 结果
     */
    @Override
    public int deleteTReturnedOrdersByReturnedOrdersId(String returnedOrdersId)
    {
        return tReturnedOrdersMapper.deleteTReturnedOrdersByReturnedOrdersId(returnedOrdersId);
    }
}
